import 'package:flutter/material.dart';

class ScrollHomePage extends StatefulWidget {
  @override
  _ScrollHomePageState createState() => _ScrollHomePageState();
}

class _ScrollHomePageState extends State<ScrollHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("scroll配置"),
      ),
      // 线性布局
      body: SingleChildScrollView(
        // 滑动的方向
        scrollDirection: Axis.horizontal,
        // 是否滑动到底部
        reverse: true,
        // 设置内边距
        padding: EdgeInsets.all(10),
        // 反弹效果
        // 有反弹 BouncingScrollPhysics()
        // 无反弹 ClampingScrollPhysics
        // 不可滑动 NeverScrollableScrollPhysics
        physics: BouncingScrollPhysics(),
        child: Container(
            child: Text("这里是SingleChildScrollView"),
            color: Colors.grey,
            width: 1500,
            height: 400),
      ),
    );
  }
}
